<template>
  <div class="container">
    <div class="title">{{ paperTitle }}</div>
    <div class="question">
      <div v-for="(item, i) in testItemList" :key="i" class="question_item">
        <div class="question_title"><span>{{ i+1 + '、' }}</span>{{ item.title }}</div>
        <el-radio-group v-model="item.id" class="options">
          <el-radio
            v-for="(type, j) in item.textList"
            :key="j"
            :label="type"
          >
            <span class="type">{{ type }}</span>
          </el-radio>
        </el-radio-group>
      </div>
    </div>
  </div>
</template>

<script>
import { findTestItemList } from '@/api/test'
export default {
  data() {
    return {
      paperTitle: '',
      testItemList: [],
      radio: ''
    }
  },
  mounted() {
    this.findTestItemList()
  },
  methods: {
    findTestItemList() {
      findTestItemList({ id: this.$route.params.id }).then(res => {
        this.paperTitle = res.data.paperName
        this.testItemList = res.data.textList
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.container{
  padding: 20px;
}
.title{
  text-align: center;
  font-weight: 700;
  font-size: 30px;
}
.question_item{
  padding: 10px;
}
.options{
  padding: 20px;
}
.question_title{
  font-size: 20px;
}
.type{
  font-size: 16px;
  font-weight: 700;
}
</style>
